package com.gqz.equip.app.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * 新能源设备信息
 *
 * @author gqz20
 * @date 2023/02/25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_EN_WZ_JF_EQUIP")
public class EnWzJfEquipEntity implements Serializable {

    /**
     * 设备编码
     */
    @TableId
    private String sbbm;

    /**
     * 设备名称
     */
    @TableField(value = "SBMC")
    private String sbmc;

    /**
     * 管理单位编码
     */
    @TableField(value = "GLDWBM")
    private String gldwbm;

    /**
     * 管理单位名称
     */
    @TableField(value = "GLDWMC")
    private String gldwmc;

    /**
     * 设备类型编码
     */
    @TableField(value = "SBLXBM")
    private String sblxbm;

    /**
     * 规格
     */
    @TableField(value = "SBGG")
    private String sbgg;

    /**
     * 型号
     */
    @TableField(value = "XH")
    private String xh;

    /**
     * 出厂编码
     */
    @TableField(value = "CCBM")
    private String ccbm;

    /**
     * 出厂日期
     */
    @TableField(value = "CCRQ")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "ccrq", format = "yyyy-MM-dd")
    private Date ccrq;

    /**
     * 运行状态编码
     */
    @TableField(value = "YXZT")
    private String yxzt;

    /**
     * 厂家名称
     */
    @TableField(value = "CJMC")
    private String cjmc;

    /**
     * 创建人
     */
    @TableField(value = "CJR")
    private String cjr;

    /**
     * 创建时间
     */
    @TableField(value = "CJTIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "cjtime", format = "yyyy-MM-dd HH:mm:ss")
    private Date cjtime;

    /**
     * 设备照片
     */
    @TableField(value = "SBZP")
    private String sbzp;

    /**
     * 设备状态编码
     */
    @TableField(value = "SBZTBM")
    private String sbztbm;

    /**
     * 是否删除 0否1是
     */
    @TableField(value = "SFSC")
    private String sfsc;

    /**
     * 设备类型名称
     */
    @TableField(value = "SBLXMC")
    private String sblxmc;

    /**
     * 运行状态
     */
    @TableField(value = "YXZTMC")
    private String yxztmc;

    /**
     * 设备状态名称
     */
    @TableField(value = "SBZTMC")
    private String sbztmc;

    /**
     * 设备上一步状态编码
     */
    @TableField(value = "SBZT_OLD")
    private String sbztOld;

    /**
     * 设备上一步状态名称
     */
    @TableField(value = "SBZT_OLDMC")
    private String sbztOldmc;

    /**
     * 所属机房编码
     */
    @TableField(value = "SSJFBM")
    private String ssjfbm;

    /**
     * 所属机房名称
     */
    @TableField(value = "SSJFMC")
    private String ssjfmc;

    /**
     * 投运日期
     */
    @TableField(value = "TYRQ")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "tyrq", format = "yyyy-MM-dd")
    private Date tyrq;

    /**
     * 是否启用 0否1是
     */
    @TableField(value = "SFQY")
    private String sfqy;

    /**
     * 物资类别编码
     */
    @TableField(value = "WZLBBM")
    private String wzlbbm;

    /**
     * 物资类别名称
     */
    @TableField(value = "WZLBMC")
    private String wzlbmc;

    /**
     * 额定电压
     */
    @TableField(value = "EDDY")
    private String eddy;

    /**
     * 额定电流
     */
    @TableField(value = "EDDL")
    private String eddl;

    /**
     * 标准
     */
    @TableField(value = "BZ")
    private String bz;

    /**
     * 频率
     */
    @TableField(value = "PL")
    private String pl;

    /**
     * 防护等级
     */
    @TableField(value = "FHDJ")
    private String fhdj;

    /**
     * Q 单位：m3/h
     */
    @TableField(value = "Q")
    private String Q;

    /**
     * H 单位：m
     */
    @TableField(value = "H")
    private String H;

    /**
     * N 单位：r/min
     */
    @TableField(value = "N")
    private String N;

    /**
     * WT 单位：kg
     */
    @TableField(value = "WT")
    private String wt;

    /**
     * 标准制冷量（kW）
     */
    @TableField(value = "BZZLL")
    private String bzzll;

    /**
     * 制冷功率（kW）
     */
    @TableField(value = "ZLGL")
    private String zlgl;

    /**
     * 标准制热量（kW）
     */
    @TableField(value = "BZZRL")
    private String bzzrl;

    /**
     * 制冷剂
     */
    @TableField(value = "ZLJ")
    private String zlj;

    /**
     * 电源
     */
    @TableField(value = "DY")
    private String dy;

    /**
     * 机组重量（kg）
     */
    @TableField(value = "JZZL")
    private String jzzl;

    /**
     * 充注量（kg）
     */
    @TableField(value = "CZL")
    private String czl;

    /**
     * 外形尺寸
     */
    @TableField(value = "WXCC")
    private String wxcc;

    /**
     * 坐标
     */
    @TableField(value = "ZB")
    private String zb;

    /**
     * start这个是必须要的动态条件集合start   start
     */
    private static Map<String, SFunction<EnWzJfEquipEntity, ?>> map;

    static {
        map = new HashMap<>();
        map.put("sbbm", EnWzJfEquipEntity::getSbbm);
        map.put("sbmc", EnWzJfEquipEntity::getSbmc);
        map.put("gldwbm", EnWzJfEquipEntity::getGldwbm);
        map.put("gldwmc", EnWzJfEquipEntity::getGldwmc);
        map.put("sblxbm", EnWzJfEquipEntity::getSblxbm);
        map.put("sbgg", EnWzJfEquipEntity::getSbgg);
        map.put("xh", EnWzJfEquipEntity::getXh);
        map.put("ccbm", EnWzJfEquipEntity::getCcbm);
        map.put("ccrq", EnWzJfEquipEntity::getCcrq);
        map.put("yxzt", EnWzJfEquipEntity::getYxzt);
        map.put("cjmc", EnWzJfEquipEntity::getCjmc);
        map.put("cjr", EnWzJfEquipEntity::getCjr);
        map.put("cjtime", EnWzJfEquipEntity::getCjtime);
        map.put("sbzp", EnWzJfEquipEntity::getSbzp);
        map.put("sbztbm", EnWzJfEquipEntity::getSbztbm);
        map.put("sfsc", EnWzJfEquipEntity::getSfsc);
        map.put("sblxmc", EnWzJfEquipEntity::getSblxmc);
        map.put("yxztmc", EnWzJfEquipEntity::getYxztmc);
        map.put("sbztmc", EnWzJfEquipEntity::getSbztmc);
        map.put("sbztOld", EnWzJfEquipEntity::getSbztOld);
        map.put("sbztOldmc", EnWzJfEquipEntity::getSbztOldmc);
        map.put("ssjfbm", EnWzJfEquipEntity::getSsjfbm);
        map.put("ssjfmc", EnWzJfEquipEntity::getSsjfmc);
        map.put("tyrq", EnWzJfEquipEntity::getTyrq);
        map.put("sfqy", EnWzJfEquipEntity::getSfqy);
        map.put("wzlbbm", EnWzJfEquipEntity::getWzlbbm);
        map.put("wzlbmc", EnWzJfEquipEntity::getWzlbmc);
        map.put("eddy", EnWzJfEquipEntity::getEddy);
        map.put("eddl", EnWzJfEquipEntity::getEddl);
        map.put("bz", EnWzJfEquipEntity::getBz);
        map.put("pl", EnWzJfEquipEntity::getPl);
        map.put("fhdj", EnWzJfEquipEntity::getFhdj);
    }
}